package com.liuyucheng.designpattern.策略模式;

import com.liuyucheng.designpattern.策略模式.strategy.Strategy;

import java.math.BigDecimal;

public class Context {
    private Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    public void setStrategy(Strategy strategy) {
        this.strategy = strategy;
    }

    public BigDecimal getPrice(BigDecimal standardPrice) {
        return this.strategy.getPrice(standardPrice);
    }
}
